Limit Switch and Homing Switch configurations and how they interact with each other and LinuxCNC.
Home and limit switches are very desirable because they add protection and consistency to your machine.
Using a home switch allows soft limits to be consistently applied and if accurate enough, allow machining without re-touch-off of tools after power down.
Soft limits act just like physical limit switches do, they stop the axis when it tries to move beyond the set limit, though if the software is miss configured or the encoder is wrong etc they are not reliable.
That is why physical limits switches are supported.
Physical limit switches are the best protection against axis crashing against the end of travel.
They should shut down the axis motor as fast as possible and should installed far enough from the end of travel so that an axis moving at a rapid speed will not hit the end of travel after the switch is activated.
Contents
-
- 1. Stepper Systems
-
-
- 1.1. Homing Basics Which way will it go
-
-
- 1.1.1. Normal Home Switch
-
- 1.1.2. Alternate Home Switch
-
- 1.1.3. New on 2.3
-
1.2. No Switches
-
- 1.3. Homing Switches Only
-
-
- 1.3.1. Home Switches Combined
-
- 1.3.2. Home Switches for each axis
-
1.4. Limit Switches Only
-
-
- 1.4.1. Limit Switches Combined
-
- 1.4.2. Limit Switch for each axis
-
1.5. Home and Limit Switches on the same input
-
- 1.6. Home Switches and Limit Switches
-
-
- 1.6.1. Home Switches Combined
-
- 1.6.2. Home Switches for each axis
-
- 1.6.3. Home Switches and Limit Switches Combined for Each Axis
-
- 1.6.4. Limit Switches Combined
-
- 1.6.5. Home/Min Limit Switch for Each Axis and Combined Max Limit Switches for all Axis
-
2. Servo Systems
-
1. Stepper Systems
- Starting with 2.2.2 you can use the Stepconf wizard for simple stepper setups.
1.1. Homing Basics Which way will it go
1.1.1. Normal Home Switch
- If you want to search for the home switch, back off, then find the home switch then use this.
- If you press the minus key to move the axis toward the home switch then all homing values will be negitive number.
- If you press the plus key to move the axis toward the home switch then all the homing values will be a positive number.
1.1.2. Alternate Home Switch
- If you want to search for the home switch, move some more in the same direction, then back up to the home switch then use this.
- If you press the minus key to move the axis toward the home switch then HOME_SEARCH_VEL is a negitive number and HOME_LATCH_VEL is a positive number.
- If you press the plus key to move the axis toward the home switch then HOME_SEARCH_VEL is a positive number and HOME_LATCH_VEL is a negitive number.
1.1.3. New on 2.3
- If your using pre-2.3 TRUNK then you have the option to move to home at a speed other than rapid.
- Set HOME_FINAL_VEL to the speed (user units per second) that you wish to move to home and it is aways a positive number.
- HOME_FINAL_VEL set to a negitive number or 0 or left out results in the move to home being at rapid speed.
1.2. No Switches
- The you set HOME_SEARCH_VEL = 0
1.3. Homing Switches Only
1.3.1. Home Switches Combined
Uses one input.
1.3.2. Home Switches for each axis
Uses one input for each axis.
1.4. Limit Switches Only
1.4.1. Limit Switches Combined
Uses one input.
1.4.2. Limit Switch for each axis
Uses one input for each axis.
1.5. Home and Limit Switches on the same input
1.6. Home Switches and Limit Switches
1.6.1. Home Switches Combined
1.6.2. Home Switches for each axis
1.6.3. Home Switches and Limit Switches Combined for Each Axis
- If you have one switch on each end of an axis that go to the same input for home and limit function.
1.6.4. Limit Switches Combined
1.6.5. Home/Min? Limit Switch for Each Axis and Combined Max Limit Switches for all Axis
If you have enough physical input pins to use one for each home switch,
why would you want to lump multiple switches on one pin? Permanently
handicapping your machine to avoid some temporary inconvenience during
configuration doesn't seem like a good tradeoff to me.
In the original mail Chris Barker wrote:
> Each axis has it's own home switch. The home switch also acts as
> a minimum limit when home isn't being used.
> 3 input pins are used. Active low.
>
> Maximum travel limits are combined on all axes in a serial conection.
> Active low.
> Only 1 pin is used on the par. port.
I don't know your actual pinout, but lets assume it is like this:
Parport pin 10 = X axis home (and min limit)
Parport pin 11 = Y axis home (and min limit)
Parport pin 12 = Z axis home (and min limit)
Parport pin 13 = combined X,Y,Z max limit
All inputs are active low (low when on the switch)
Then the limit section of your hal file should look something like this:
# connect pin 10 to X home and min limit
net X-home parport.0.pin-10-in-not => axis.0.home-sw-in axis.0.neg-lim-sw-in
# connect pin 11 to Y home and min limit
net Y-home parport.0.pin-11-in-not => axis.1.home-sw-in axis.1.neg-lim-sw-in
# connect pin 12 to Z home and min limit
net Z-home parport.0.pin-12-in-not => axis.2.home-sw-in axis.2.neg-lim-sw-in
# connect pin 13 to all three max limits
net XYZ-max-lim parport.0.pin-13-in-not => axis.0.pos-lim-sw-in
axis.1.pos-lim-sw-in axis.2.pos-lim-sw-in
Notes:
Lines beginning with # are comments, you can put whatever you want
there. Write something that will make sense to you when you are
troubleshooting five years from now.
Lines beginning with "net" create a HAL signal that connects things
together. In this case, it connects a parport pin to LinuxCNC. Everything
after "net" is on one line (my mail client is wrapping the long lines,
and yours might too). "X-home", "Y-home", "Z-home", and "XYZ-max-lim"
are signal names, and can be whatever makes sense to you. The remaining
names on each line are the pins that the signal connects, and must be
names that already exist in the system. The "=>" arrows are optional,
and are used to show a human reading the file which way the signal is
flowing.
Regards,
John Kasunich
Hall based Limit Switches
At the request of folks on the mailing list I have posted the (Eagle PCB) design for the limit switches I use on my machines here:
upload:CNC-Hall%20Board.sch
upload:CNC-Hall%20Board.brd
All passives are 0603 except for C1 which is 1206
The hall is an allegro A3213 (A3213ELHLT-T)
The connector is an RJ11-6P4C Digikey A31421-ND
The board is designed such that the RJ connector can be reversed at assembly time.
Doug Metzler
2. Servo Systems